import com.java.service.UConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //1.得到容器对象
        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");

        //2.得到Bean对象
//        User user=context.getBean("userinfo",User.class);
//        Student student=context.getBean("student",Student.class);
//        UserService userService=context.getBean("userService",UserService.class);
        //注：首字母和第二个字母大写返回原类名，否则就是首字母小写
        UConfig uConfig=context.getBean("UConfig", UConfig.class);

        //3.使用Bean对象
//        user.sayHi();
//        student.sayHi();
//        userService.sayHi();
        uConfig.sayHi();
    }
}
